#ifndef PANELITEM_H
#define PANELITEM_H

#include "AbstractShapeItem.h"

class AbstractPanel;
class AbstractManager;
class GraphicsText;
class GraphicsButton;

#define DEFAULT_FONT_COLOR "#575757"
#define DEFAULT_BACKGROUND_COLOR "#FFFFFF"

class PanelItem : public AbstractShapeItem
{
	Q_OBJECT

public:

	const static int HEIGHT = 23;
	const static int RIGHT_PADDING = 10;
	const static int LEFT_PADDING = 15;
	const static int TOP_PADDING = 5;
	const static int TEXT_LENGTH_LIMIT = 80;
	const static int TYPE_BLOCK_RIGHT_PADDING = 4;
	const static int TYPE_BLOCK_LEFT_PADDING = 4;

	PanelItem(std::string,  AbstractManager*, AbstractPanel*);
	~PanelItem();
	void setName(std::string);
	void setNameEditable(bool);
	void setRemovable(bool);
	void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget *);
	QRectF boundingRect() const;
	virtual void setParent(PanelItem*);
	PanelItem* getParent();


public slots:
	void remove();

protected:
	AbstractPanel* _panel;
	bool _isRemovable;
	std::string _type;
	GraphicsText *_graphicsTextName;
	PanelItem* _parent;
	virtual void initName();
	virtual void drawType( QPainter * painter );
};

#endif // PANELITEM_H
